import request from '@/utils/request'

// 查询列表
export function listDept(query) {
  return request({
    url: '/wasm/type/list',
    method: 'get',
    params: query
  })
}
export function listDept1(query) {
  return request({
    url: '/wasm/type/treeselect',
    method: 'get',
    params: query
  })
}

// 查询列表（排除节点）
export function listDeptExcludeChild(deptId) {
  return request({
    url: '/wasm/type/list/exclude/' + deptId,
    method: 'get'
  })
}

// 查询详细
export function getDept(deptId) {
  return request({
    url: '/wasm/type/' + deptId,
    method: 'get'
  })
}

// 查询下拉树结构
export function treeselect() {
  return request({
    url: '/system/dept/treeselect',
    method: 'get'
  })
}

// 根据ID查询树结构
export function roleDeptTreeselect(roleId) {
  return request({
    url: '/system/dept/roleDeptTreeselect/' + roleId,
    method: 'get'
  })
}

// 新增
export function addDept(data) {
  return request({
    url: '/wasm/type',
    method: 'post',
    data: data
  })
}

// 修改
export function updateDept(data) {
  return request({
    url: '/wasm/type',
    method: 'put',
    data: data
  })
}

// 删除
export function delDept(deptId) {
  return request({
    url: '/wasm/type/' + deptId,
    method: 'delete'
  })
}


// 仓库列表
// 查询仓库产品列表
export function listProduct(query) {
  return request({
    url: '/wasm/product/list',
    method: 'get',
    params: query
  })
}

// 查询仓库产品详细
export function getProduct(id) {
  return request({
    url: '/wasm/product/' + id,
    method: 'get'
  })
}

// 新增仓库产品
export function addProduct(data) {
  return request({
    url: '/wasm/product',
    method: 'post',
    data: data
  })
}

// 出库
export function outProduct(query) {
  return request({
    url: '/wasm/product/delivery',
    method: 'get',
    params: query
  })
}

// 修改仓库产品
export function updateProduct(data) {
  return request({
    url: '/wasm/product',
    method: 'put',
    data: data
  })
}

// 删除仓库产品
export function delProduct(id) {
  return request({
    url: '/wasm/product/' + id,
    method: 'delete'
  })
}

// 导出仓库产品
export function exportProduct(query) {
  return request({
    url: '/wasm/product/export',
    method: 'get',
    params: query
  })
}

// 查询出入库记录列表
export function listRecord(query) {
  return request({
    url: '/wasm/record/list',
    method: 'get',
    params: query
  })
}

// 查询出入库记录详细
export function getRecord(id) {
  return request({
    url: '/wasm/record/' + id,
    method: 'get'
  })
}

// 新增出入库记录
export function addRecord(data) {
  return request({
    url: '/wasm/record',
    method: 'post',
    data: data
  })
}

// 修改出入库记录
export function updateRecord(data) {
  return request({
    url: '/wasm/record',
    method: 'put',
    data: data
  })
}

// 删除出入库记录
export function delRecord(id) {
  return request({
    url: '/wasm/record/' + id,
    method: 'delete'
  })
}

// 导出出入库记录
export function exportRecord(query) {
  return request({
    url: '/wasm/record/export',
    method: 'get',
    params: query
  })
}